package com.dfbz.demo01;

import java.util.Calendar;
import java.util.Date;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo04_Calendar计算 {
    public static void main(String[] args) {

        // 创建一个日历
        Calendar calendar = Calendar.getInstance();

        calendar.add(Calendar.YEAR,-2);

        System.out.println(calendar.get(Calendar.YEAR));

        Date date = calendar.getTime();
        System.out.println(date);

    }
}
